package org.r.pdc.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/welcome")
public class WelcomeController {
	
	@RequestMapping("/sayHi")
	public Object sayHi(){
		return "Hi, this is a SpringMVC RestfulAPI Test.";
	}
	@RequestMapping("/tellme/{name}" )
	public User tellMePassword(@PathVariable String name){
		User user = new User();
		user.setUserName(name);
		user.setPassword("778");
		return user;
	}
	
	
	class User{
		private String userName;
		private String password;
		public String getUserName() {
			return userName;
		}
		public void setUserName(String userName) {
			this.userName = userName;
		}
		public String getPassword() {
			return password;
		}
		public void setPassword(String password) {
			this.password = password;
		}
	}
}
